<?php
class topbanner_html{
	function display($rows){
		?>
		<form action="index.php?option=com_topbanner" method="post" name="adminForm">
			<table class="adminlist">
				<thead>
					<tr>
						<th width="5%" align="left">
							<?php echo JText::_( 'Num' ); ?>
						</th>
						<th width="10%">
							<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo (count( $rows )+1);?>);" />
						</th>
						<th width="70%" class="nowrap">
							<?php echo "Menu Name"; ?>
						</th>
						
					</tr>
				</thead>
				<tbody>
					<?php
						$k = 0;
						$n = count($rows);
						if( count($rows) ) {
							for($i = 0; $i < $n; $i++) {
								$row =& $rows[$i];
								JFilterOutput::objectHtmlSafe($row);
								?>
								<tr class="<?php echo "row$k"; ?>">
									<td align="center"><?php echo  $i; ?></td>
									<td align="center"><input type="checkbox" id="cb<?php echo $i + 1; ?>" name="cid[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);"></td>
									<td align="center">
										<a href="index.php?option=com_topbanner&task=edit&id=<?php echo $row->id; ?>"><?php echo $row->image; ?></a>
									</td>
								</tr>
								<?php
							}
						}
					?>
				</tbody>
			</table>
			<input type="hidden" name="option" value="com_topbanner" />
			<input type="hidden" name="section" value="" />
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="chosen" value="" />
			<input type="hidden" name="act" value="" />
			<input type="hidden" name="boxchecked" value="0" />
			<!--<input type="hidden" name="type" value="<?php echo $type; ?>" />-->
			<input type="hidden" name="filter_order" value="" />
			<input type="hidden" name="filter_order_Dir" value="" />
			<?php echo JHTML::_( 'form.token' ); ?>
		</form>
		
		<?php
	}
	function updateForm($row){
		JRequest::setVar( 'hidemainmenu', 1 );
		$id = @JRequest::getInt("id");
		//var_dump($row);
		$jconf = new JConfig();
		$live_site = $jconf->live_site;
		?>
		<form action="index.php" method="post" name="adminForm" enctype="multipart/form-data" >
			<div class="col width-60">
				<fieldset class="adminform">
				<legend><?php echo JText::_( 'Banner' ); ?></legend>
				<table class="admintable">
					<tr>
						<td class="key">
							<label for="title" width="100">Current English Image:</label>
						</td>
						<td>
							<img src="<?php if(count($row) > 0) echo $live_site."/images/topbanner/".$row[0]->image; ?>" width="200" />
						</td>
					</tr>
					<tr><td class="key"><label for="title" width="100">
							<?php echo JText::_( 'Upload English image' ); ?>:
							</label>
						</td>
						<td>
							<input id="file_image" name="file_image" type="file" /> 
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="title" width="100">Current Danish Image:</label>
						</td>
						<td>
							<img src="<?php if(count($row) > 0) echo $live_site."/images/topbanner/".$row[0]->link; ?>" width="200" />
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="title" width="100">
								<?php echo JText::_( 'Danish Image' ); ?>:
							</label>
						</td>
						<td colspan="2">
							<input type="file" name="link" id="link" />
						</td>
					</tr>
				</table>
				</fieldset>
			</div>
			<input type="hidden" name="option" value="com_topbanner" />
			<input type="hidden" name="edit" value="true" />
			<input type="hidden" name="id" value="<?php echo $id ?>" />
			<input type="hidden" name="sectionid" value="" />
			<input type="hidden" name="redirect" value="" />
			<input type="hidden" name="task" value="update" />
			<?php echo JHTML::_( 'form.token' ); ?>
		</form>	
		<?php
	}
}
